from pathlib import Path
import re

log_file = Path("user.log")

with open(log_file, "r", encoding="utf-8") as f:
    lines = f.read().split("\n")
    for line in range(len(lines)):
        txt = lines[line]
        res = re.findall("Performance of EPOCH [0-9]{2}", txt)
        if res:
            # print(res[0])
            print(txt)
            lines[line+9] = "Car AP@0.70, 0.70, 0.70:"
            print(lines[line+12])
            # for txt in lines[line+9:line+69]:
            #     if "@" in txt or "3d   AP" in txt:
            #         print(txt)
            # print("\n".join(lines[line+9:line+69]))
